package com.jun.basic.handler;

import com.jun.basic.utils.JsonData;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import javax.servlet.http.HttpServletRequest;

@RestControllerAdvice
public class CustomExtHandler {
    @ExceptionHandler(value = Exception.class)
    JsonData<String> handle(Exception e, HttpServletRequest request) {
        return JsonData.buildFail(-2, "网络正忙，请稍后重试");
    }
}
